

package jumavidesktop.Persistencia.entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 *
 * @author vimso
 */
@Entity
@Table(name = "configanpr")
@NamedQueries({
    @NamedQuery(name = "Configanpr.findAll", query = "SELECT c FROM Configanpr c"),
    @NamedQuery(name = "Configanpr.findById", query = "SELECT c FROM Configanpr c WHERE c.id = :id"),
    @NamedQuery(name = "Configanpr.findByCamaraid", query = "SELECT c FROM Configanpr c WHERE c.camara = :camara")})
public class Configanpr implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE)
    @Column(name = "id")
    private Integer id;
    @JoinColumn(name = "Camara_id", referencedColumnName = "id", insertable = true, updatable =true)
    @OneToOne(optional = false)
    private Camara camara;
    @Basic(optional = false)
    @Column(name = "SizeMax",nullable=false)
    private Integer sizeMax;
    @Basic(optional = false)
    @Column(name = "SizeMin",nullable=false)
    private Integer sizeMin;
    

    public Configanpr() {
    }
    

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }
    public Camara getCamara() {
        return camara;
    }

    public void setCamara(Camara camara) {
        this.camara = camara;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Configanpr)) {
            return false;
        }
        Configanpr other = (Configanpr) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jumavidesktop.Persistencia.entidades.Configanpr[ id=" + id + " ]";
    }

    public Integer getSizeMax() {
        return sizeMax;
    }

    public void setSizeMax(int sizeMax) {
        this.sizeMax = sizeMax;
    }

    public Integer getSizeMin() {
        return sizeMin;
    }

    public void setSizeMin(int sizeMin) {
        this.sizeMin = sizeMin;
    }

}
